<?php

namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Models\News;

class IndexController extends Controller
{
    protected $news;
    //实例化类
    public function __construct()
    {
        $this->news = new News();
    }
    function index(){
        $data['newCount'] =  $this->news->where('type',1)->count();
        $data['picCount'] =  $this->news->where('type',2)->count();
        return view('Admin.index',$data);
    }
}
